/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.TransferState;
import com.qinyetech.springstage.core.entity.AbstractEntity;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * ClassName: TransferOrder <br/>
 * Function: 调拨单据 <br/>
 * date: 2018-11-08 14:02:44 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="transfer_orders")
public class TransferOrder extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 单号 
    @Column(name="no", length = 300)
	private String no = null;

	// 调出仓库
    @Column(name="transfer_out_id")
	private Long transferOutId = null;
	// 调出仓库
    @Column(name="transfer_out_name")
	private String transferOutName = null;

	// 调入仓库
    @Column(name="transfer_in_id")
	private Long transferInId = null;
	// 调入仓库
	@Column(name="transfer_in_name")
	private String transferInName = null;

	// 操作人 
    @Column(name="operator")
	private Long operator = null;

	// 操作人
	@Column(name="operator_name")
	private String operatorName = null;

	// 调拨日期 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="operate_time")
	private Date operateTime = null;

	// 金额 
    @Column(name="amount",scale=2)
	private Double amount = null;

	// 状态 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private TransferState state = null;


    @Tolerate
	public TransferOrder() {
		
	}
    @Tolerate
	public TransferOrder(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取单号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置单号
     */
	public TransferOrder setNo(String no) {
		this.no = no;
		return this;
	}

	/**
	 * 获取调出仓库
	 */
	public Long getTransferOutId() {
		return this.transferOutId;
	}

    /**
     * 设置调出仓库
     */
	public TransferOrder setTransferOutId(Long transferOutId) {
		this.transferOutId = transferOutId;
		return this;
	}

	/**
	 * 获取调入仓库
	 */
	public Long getTransferInId() {
		return this.transferInId;
	}

    /**
     * 设置调入仓库
     */
	public TransferOrder setTransferInId(Long transferInId) {
		this.transferInId = transferInId;
		return this;
	}

	/**
	 * 获取操作人
	 */
	public Long getOperator() {
		return this.operator;
	}

    /**
     * 设置操作人
     */
	public TransferOrder setOperator(Long operator) {
		this.operator = operator;
		return this;
	}

	/**
	 * 获取调拨日期
	 */
	public Date getOperateTime() {
		return this.operateTime;
	}

    /**
     * 设置调拨日期
     */
	public TransferOrder setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
		return this;
	}

	/**
	 * 获取金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置金额
     */
	public TransferOrder setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	public String getTransferOutName() {
		return transferOutName;
	}

	public void setTransferOutName(String transferOutName) {
		this.transferOutName = transferOutName;
	}

	public String getTransferInName() {
		return transferInName;
	}

	public void setTransferInName(String transferInName) {
		this.transferInName = transferInName;
	}

	public TransferState getState() {
		return state;
	}

	public void setState(TransferState state) {
		this.state = state;
	}

	public String getOperatorName() {
		return operatorName;
	}

	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}
}
